const router = require('koa-router')();
const compose = require('../modules/compose');

//获取数据
router.get('/usercompose',async (ctx,next) => {
    ctx.body = await compose.selectCompose();  
})
//增加数据
router.post('/usercompose',async (ctx,next) => {
    ctx.body = await compose.addCompose(ctx.request.body)
})
//删除数据
router.delete('/usercompose/:compose_id',async (ctx,next) => {
    ctx.body = await compose.deleteCompose(ctx.params);
})
//修改数据
router.put('/usercompose',async (ctx,next) => {
    ctx.body = await compose.putCompose(ctx.request.body)
})

module.exports = router;